﻿@{
    ViewBag.Title = "LoginWeb";
}

<html>
    <head>


        <script src="~/Scripts/jquery-1.7.1.js"></script>

        <title>  登录</title>
        <style type="text/css" >
            #content {
            margin:auto;
            width:300px;
            height:200px;
            border:1px solid black;
            line-height:300px;
            
            }
            #content table tr {
                    display :block;
                margin-bottom :50px ;
             
                }




        </style>
        <script type="text/javascript" >
            $(function () {
                $("#stu").click(function () {
                    $.ajax({
                        url: '/Login/LoginWebs',
                        type: 'post',
                        dataType: 'json',
                        data: { name: $("#name").val(), pwd: $("#pwd").val() },
                        success:function(res){
                            alert(res.mag);
                            if (res.flag) {
                                window.location.href = "/Person/personnel"
                            }
                        }, error: function (er) {
                            alert("登录失败！");
                        }
                        })

                })


            })

        </script>
    </head>

<body>
    <div id="content">
        <table>
            <tr>
                <td>
                  用户名:
                </td>
                <td>
                   <input  type="text" id="name"/>
                </td>
            </tr>
            <tr>
                <td>密码：</td>
                <td><input  type="password" id="pwd" /></td>
            </tr>
             <tr>
                <td colspan ="2" style="text-align :center; margin:auto ;display:block">
                    <input  type="button" value ="确定" style="margin-left:30px" id ="stu" />
                    <input  type="button" value="取消" style="margin-left:100px" id="qu" /></td>
                
            </tr>
        </table>
      



    </div>
</body>


















</html>
